package com.brokendust.client.api.util;

public class BasePosition {
    public static Integer[] getMenuPoint(int window_width, int window_height, int menu_weight, int menu_height, int x, int y, int position) {
        switch (position) {
            case 1: {
                return new Integer[]{x, y};
            }
            case 2: {
                return new Integer[]{window_width / 2 - menu_weight / 2 + x, y};
            }
            case 3: {
                return new Integer[]{window_width - menu_weight + x, y};
            }
            case 4: {
                return new Integer[]{x, window_height / 2 - menu_height / 2 + y};
            }
            case 5: {
                return new Integer[]{window_width / 2 - menu_weight / 2 + x, window_height / 2 - menu_height / 2 + y};
            }
            case 6: {
                return new Integer[]{window_width - menu_weight + x, window_height / 2 - menu_height / 2 + y};
            }
            case 7: {
                return new Integer[]{x, window_height - menu_height + y};
            }
            case 8: {
                return new Integer[]{window_width / 2 - menu_weight / 2 + x, window_height - menu_height + y};
            }
            case 9: {
                return new Integer[]{window_width - menu_weight + x, window_height - menu_height + y};
            }
            default: {
                return new Integer[]{0, 0};
            }
        }
    }

    public static Integer[] getObjectPoint(int guiX, int guiY, int guiWeight, int guiHeight, int objectWeight, int objectHeight, int x, int y, int position) {
        switch (position) {
            case 1: {
                return new Integer[]{guiX + x, guiY + y};
            }
            case 2: {
                return new Integer[]{guiX + guiWeight / 2 - objectWeight / 2 + x, guiY + y};
            }
            case 3: {
                return new Integer[]{guiX + guiWeight - objectWeight + x, guiY + y};
            }
            case 4: {
                return new Integer[]{guiX + x, guiY + guiHeight / 2 - objectHeight / 2 + y};
            }
            case 5: {
                return new Integer[]{guiX + guiWeight / 2 - objectWeight / 2 + x, guiY + guiHeight / 2 - objectHeight / 2 + y};
            }
            case 6: {
                return new Integer[]{guiX + guiWeight - objectWeight + x, guiY + guiHeight / 2 - objectHeight / 2 + y};
            }
            case 7: {
                return new Integer[]{guiX + x, guiY + guiHeight - objectHeight + y};
            }
            case 8: {
                return new Integer[]{guiX + guiWeight / 2 - objectWeight / 2 + x, guiY + guiHeight - objectHeight + y};
            }
            case 9: {
                return new Integer[]{guiX + guiWeight - objectWeight + x, guiY + guiHeight - objectHeight + y};
            }
            default: {
                return new Integer[]{0, 0};
            }
        }
    }

    public static Integer[] getObjectHubPoint(int windowWidth, int windowHeight, int objectWeight, int objectHeight, int x, int y, int position) {
        switch (position) {
            case 1: {
                return new Integer[]{x, y};
            }
            case 2: {
                return new Integer[]{windowWidth / 2 - objectWeight / 2 + x, y};
            }
            case 3: {
                return new Integer[]{windowWidth - objectWeight + x, y};
            }
            case 4: {
                return new Integer[]{x, windowHeight / 2 - objectHeight / 2 + y};
            }
            case 5: {
                return new Integer[]{windowWidth / 2 - objectWeight / 2 + x, windowHeight / 2 - objectHeight / 2 + y};
            }
            case 6: {
                return new Integer[]{windowWidth - objectWeight + x, windowHeight / 2 - objectHeight / 2 + y};
            }
            case 7: {
                return new Integer[]{x, windowHeight - objectHeight + y};
            }
            case 8: {
                return new Integer[]{windowWidth / 2 - objectWeight / 2 + x, windowHeight - objectHeight + y};
            }
            case 9: {
                return new Integer[]{windowWidth - objectWeight + x, windowHeight - objectHeight + y};
            }
            default: {
                return new Integer[]{0, 0};
            }
        }
    }
}
